<template>
  <div class="message-box" @click="messageEvent">
    <div class="box" v-if="shows">
      <Spin fix>
        <Icon type="ios-loading" size="48" class="demo-spin-icon-load"></Icon>
        <div style="font-size:24px">Loading</div>
      </Spin>
    </div>
  </div>
</template>

<script>
export default {
  name: "Message",
  data() {
    return {
      messagePtoto: "success_photo",
      type: "info",
      text: "",
      shows: false,
      time: 1000
    };
  },
  methods: {
    messageEvent() {
      //  this.shows = false;
    }
  },
  watch: {
    shows(newVal) {
      // console.log(newVal,'newVal');
      this.$el.parentNode.removeChild(this.$el);
    }
  },
  mounted() {
    var _this = this;
    // if(this.type == 'success'){
    //     this.messagePtoto = 'success_photo'
    // }else{
    //     this.messagePtoto = 'err_photo'
    // }
    // setTimeout(function(){
    //     _this.shows = false;
    // },_this.time)
  }
};
</script>

<style lang="scss" scoped>
@import "./message.scss";
</style>
